<?php
include ($_SERVER['DOCUMENT_ROOT'].'/standart/checkUser.php');
if(isset($_POST["selectBox"])){
	$db = connect();
	$id = $_POST["selectBox"];
	$data = $_POST["CONTENT_DATA"];
	$stmt ="UPDATE WEB_CONTENT SET CONTENT_TEXT = ? WHERE ID = ?";
	$statement = $db->prepare($stmt);
	$statement->bind_param('si', $data, $id);
	if ($statement->execute()){
		$statement->close();
		echo '<script LANGUAGE="JavaScript">';
		echo 'window.location="/webContent/addContent.php?selectId='.$id.'";';
		echo '</script>';
	} else {
		echo "error";
	}
	disconnect($db);
}else {
	echo "<div id=\"getContentSpan\"></div>";
}
?>
